$.get('/admin/visual/month_user_count').done(function (data) {
    var myChart = echarts.init(document.getElementById('month_user_count'),'macarons');
    myChart.setOption ({
        title : {
            text: '用户增长情况',
            subtext: data.time_start + ' ~ ' + data.time_end,
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['游客','注册用户']
        },
        series : [
            {
                name: '类型',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:data.guest, name:'游客'},
                    {value:data.user, name:'注册用户'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    });
    window.onresize = myChart.resize;
});
